<?php
class Admin_Model_Series extends My_Model_Abstract
{
    protected $_mainTable = 'series';

    protected $_idFieldName = 'p_series';

    public function getCollection($archive = false)
    {
        $select = $this->getAdapter()->select()
        ->from($this->_mainTable);
        $select->where('deleted = ?', 0);
        if ($archive) {
            $select->where('archive = ?', $archive);
        }
        $select->order('titre');
        return $select;
        //return $this->getAdapter()->fetchAll($select);
    }

	public function getListSerie($where='')
	{
		$sql = "SELECT * FROM series WHERE deleted = 0";
    	if($where) {
    		$sql .= " AND archive = $_GET[archive]";
    	}
    	$sql .= " ORDER BY titre";

		return $this->getAdapter()->fetchAll($sql);
	}
}